package com.cxria.springboottest.conf

import com.cxria.springboottest.exception.DefaultExceptionHandler
import org.springframework.boot.context.properties.ConfigurationProperties
import org.springframework.context.annotation.Bean
import org.springframework.context.annotation.Configuration
import org.springframework.web.server.WebFilter
import org.springframework.web.servlet.config.annotation.ViewControllerRegistry
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter

@Configuration
class MvcConfig extends WebMvcConfigurerAdapter {

    @Override
    void addViewControllers(ViewControllerRegistry registry) {
        registry.addViewController('/login').setViewName('login')
    }

    @Bean
    DefaultExceptionHandler defaultExceptionHandler(){
        return new DefaultExceptionHandler()
    }

}
